Strict

Import agfx

Global myTmpScreen:TTmpScreen

Class TAgfx_test_app Extends TFramework

	Method OnCreate:Int()
		
		Super.OnCreate()
				
		myTmpScreen = New TTmpScreen		
		myTmpScreen.Prepare()
		
		Return 0
	End
	
End


Class TTmpScreen Extends TScreen
	
	Field AppData:TProperties 
	' START when app is created
	Method Start:Void()
		Self.AppData = New TProperties()
		
		Self.AppData.Add(New TProperty("var_01_i",1))
		Self.AppData.Add(New TProperty("var_01_s","str_1"))
		Self.AppData.Add(New TProperty("var_01_f",1.1))
		Self.AppData.Add(New TProperty("var_01_b",True))
		
		Self.AppData.Add(New TProperty("var_02_i",2))
		Self.AppData.Add(New TProperty("var_02_s","str_2"))
		Self.AppData.Add(New TProperty("var_02_f",2.2))
		Self.AppData.Add(New TProperty("var_02_b",False))
		
		Print ("------------ test clean")
		Self.AppData.Delete()
		Self.AppData.Load()
		Print(Self.AppData.ToString())

		Print ("------------ test Save")
		Self.AppData.Save()

		Print ("------------ test Load")
		Self.AppData.Load()

		Print(Self.AppData.ToString())

		Print ("------------ test change")
		Self.AppData.SetProperty("var_01_i",20)
				
		Print(Self.AppData.Find("var_01_i"))
		
		Self.AppData.SetProperty("var_01_i",22)
		Print(Self.AppData.Get("var_01_i"))


	End
	
	' main app logic loop update
	Method Update:Void()
		
	End
	
	' main app render loop
	Method Render:Void()
		Cls
		
	End
End
